package com.core.website.mapper;

import com.core.website.entity.Content;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ContentMapper {
    int add(Content content);
    int edit(Content content);
    int changeNo(Content content);
    int delete(@Param("list") List<String> ids);
    List<Content> queryAll(Content content);
    List<Content> queryFourData(Content content);
    List<Content> queryApprovalPage(@Param("content") Content content,@Param("columnIdList") List<String> columnIdList);
    List<Content> queryTransferApprovalPage(Content content);
    List<Content> queryNewAll();
    List<Content> queryCascadeAll(Content content);
    Content queryById(String id);
    void thumbs(String id);
    int top(@Param("id") String id,@Param("type") String type);
    int nice(@Param("id") String id,@Param("type") String type);
    int unNew(List<String> list);
    int approval(@Param("contentId") String contentId,@Param("approvalResult") String approvalResult,@Param("approvalReason") String reason,@Param("newContent") String newContent,@Param("userName") String userName);
    List<Content> queryCascadeContentGroupByColumnId(@Param("list") List<String> idList, @Param("orgId") String orgId);
    List<Content> queryGroupByOrg(@Param("id")String id, @Param("orgId") String orgId);
    void addThumbs(@Param("ip") String ip,@Param("id") String id);
    int queryThumbs(@Param("ip") String ip,@Param("id") String id);
    int queryTodayNum();
    int queryTotalNum();
    List<Map<String,Object>> statistics1(String year);
    List<Map<String,Object>> statistics2(String year);
    List<Map<String,Object>> statistics5(String year);
    List<Map<String,Object>> mainBanner();
    List<String> getApprovalAuthByOrgId(String orgId);
    void deleteApprovalAuthByOrgId(String orgId);
    void saveApprovalAuthByOrgId(@Param("orgId") String orgId,@Param("columnId") String columnId);
    /**每个新闻的点击数增加10次点击*/
    void thumbsNum(int num);

    /**
     * 根据机构查询内容
     * @param content
     * @return
     */
    List<Content> queryListByOrg(Content content);

    /**
     * 批量添加数据
     * @param list
     */
    void batchSaveApprovalAuthByOrgId(List<Map> list);
}